package cn.itsource.zcn.org.mapper;

import cn.itsource.zcn.org.domain.Systemdictionarydetail;
import cn.itsource.zcn.org.domain.Systemdictionarytype;
import cn.itsource.zcn.org.query.SystemdictionarydetailQuery;
import cn.itsource.zcn.org.query.SystemdictionarytypeQuery;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * (Systemdictionarydetail)表数据库访问层
 *
 * @author makejava
 * @since 2021-08-14 09:12:09
 */
public interface SystemdictionarydetailMapper {

    /**
     * 新增数据
     *
     * @param tSystemdictionarydetail 实例对象
     */
    @Insert("insert into t_systemdictionarydetail" +
            "(name,types_id)" +
            "values (#{name},#{types_id})")
    void save(Systemdictionarydetail tSystemdictionarydetail);

    /**
     * 修改数据
     *
     * @param tSystemdictionarydetail 实例对象
     */
    @Update("update t_systemdictionarydetail set " +
            "name=#{name},types_id=#{types_id} " +
            "where id = #{id}")
    void update(Systemdictionarydetail tSystemdictionarydetail);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     */
    @Delete("delete from t_systemdictionarydetail where id = #{id} ")
    void delete(Long id);


    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Select("select * from t_systemdictionarydetail where id = #{id}")
    Systemdictionarydetail queryById(Long id);

    /**
     * 查询全部
     *
     * @return 对象列表
     */
    @Select("select * from t_systemdictionarydetail")
    List<Systemdictionarydetail> queryAll();

    /**
     * 批量新增数据（MyBatis原生foreach方法）
     *
     * @param entities List<Systemdictionarydetail> 实例对象列表
     */
    void insertBatch(@Param("Systemdictionarydetails") List<Systemdictionarydetail> entities);

    /**
     * 批量删除数据（MyBatis原生foreach方法）
     *
     * @param ids List<Integer> 实例对象列表
     */
    void deleteBatch(@Param("ids") List<Integer> ids);

    /**
     * 根据条件查询所有条数
     * @return
     */
    Integer count(SystemdictionarydetailQuery systemdictionarydetailQuery);

    /**
     * 根据条件拿到所有数据
     * @param systemdictionarydetailQuery
     * @return
     */
    List<Systemdictionarydetail> pageQuery(SystemdictionarydetailQuery systemdictionarydetailQuery);

}

